import fetch from "@/utils/fetch"

export function getInfoByPage(params) {
  return fetch({
    url: `/netGrid/getNetGridMemberQuery`,
    method: `post`,
    params: {
      name: params.name,
      certID: params.certID,
      netGridID: params.netGridID,
      page: params.page,
      pageSize: params.pageSize
    }
  })
}

export function addInfo(params) {
  return fetch({
    url: `/netGrid/insertNetGridMember`,
    method: `post`,
    data: params
  })
}

export function getEditInfo(id) {
  return fetch({
    url: `/netGrid/getNetGridMemberDetailToUpdate`,
    method: `get`,
    params: {
      id: id
    }
  })
}

export function update(params) {
  return fetch({
    url: `/netGridMember/updateNetGridMember`,
    method: `post`,
    data: params
  })
}

// /deleteNetGridMember
export function deleteById(id) {
  return fetch({
    url: `/netGridMember/deleteNetGridMember`,
    method: `post`,
    params: {
      id: id
    }
  })
}

export function getNetGridMemberDetail(id) {
  return fetch({
    url: "/netGrid/getNetGridMemberDetail",
    method: `post`,
    params: {
      id: id
    }
  })
}

export function getNetGridMemberHistogram() {
  return fetch({
    url: `/netGrid/getNetGridMemberHistogram`,
    method: "get"
  })
}

// 上报者分页
export function getNetGridEventReporterQuery(query) {
  return fetch({
    url: `/netGrid/getNetGridEventReporterQuery`,
    method: `post`,
    params: {
      id: query.id,
      kind: query.kind,
      name: query.name,
      netGridID: query.netGridID,
      status: query.status,
      page: query.page,
      pageSize: query.pageSize
    }
  })
}

// 指派者分页信息
export function getNetGridEventDespatcherQuery(query) {
  return fetch({
    url: `/netGrid/getNetGridEventDespatcherQuery`,
    method: `post`,
    params: {
        id: query.id,
        kind: query.kind,
        name: query.name,
        netGridID: query.netGridID,
        status: query.status,
        page: query.page,
        pageSize: query.pageSize
    }
  })
}
//部门负责人分页信息
export function getNetGridEventDeptDespatcherQuery(query) {
  return fetch({
    url: `/netGrid/getNetGridEventDeptDespatcherQuery`,
    method: `post`,
    params: {
        id: query.id,
        kind: query.kind,
        name: query.name,
        netGridID: query.netGridID,
        status: query.status,
        page: query.page,
        pageSize: query.pageSize
    }
  })
}

// 事件处理者分页信息
export function getNetGridEventHandlerQuery(query) {
  return fetch({
    url: `/netGrid/getNetGridEventHandlerQuery`,
    method: `post`,
    params: {
      id: query.id,
      kind: query.kind,
      name: query.name,
      netGridID: query.netGridID,
      status: query.status,
      page: query.page,
      pageSize: query.pageSize
    }
  })
}

// 事件审核者分页信息
export function getNetGridEventAuditorQuery(query) {
  return fetch({
    url: `/netGrid/getNetGridEventAuditorQuery`,
    method: `post`,
    params: {
      id: query.id,
      kind: query.kind,
      name: query.name,
      netGridID: query.netGridID,
      status: query.status,
      page: query.page,
      pageSize: query.pageSize
    }
  })
}


// insertNetGridEventBasic
export function insertNetGridEventBasic(query) {
  return fetch({
    url: `/netGrid/insertNetGridEventBasic`,
    method: `post`,
    data: query
  })
}

// /addNetGridEventInvolvedPersons
export function addNetGridEventInvolvedPersons(query) {
  return fetch({
    url: `/netGrid/addNetGridEventInvolvedPersons`,
    method: `post`,
    data: query
  })
}

// 事件处理
export function addNetGridEventDealingBasic(query) {
  return fetch({
    url: `/netGrid/addNetGridEventDealingBasic`,
    method: `post`,
    data: query
  })
}


// 事件派发
export function addNetGridEventDistribute(query) {
  return fetch({
    url: `/netGrid/addNetGridEventDistribute`,
    method: `post`,
    data: query
  })
}

// 事件审核
export function addNetGridEventChecked(query) {
  return fetch({
    url: `/netGrid/addNetGridEventChecked`,
    method: `post`,
    data: query
  })
}

// updateNetGridEventStatus
export function updateNetGridEventStatus(type, id) {
  return fetch({
    url: `/netGrid/updateNetGridEventStatus`,
    method: `post`,
    params: {
      type: type,
      id: id
    }
  })
}

// getNetGridEventDetail
export function getNetGridEventDetail(id) {
  return fetch({
    url: `/netGrid/getNetGridEventDetail`,
    method: `post`,
    params: {
      id: id
    }
  })
}

export function getNetGridQuery(query){
  return fetch({
    url:`/netGrid/getNetGridQuery`,
    method:`post`,
    params:{
      netGridName:query.netGridName,
      netGridLeaderName:query.netGridLeaderName,
      page:query.page,
      pageSize:query.pageSize
    }
  })
}

export function getNetGridDetail(id){
  return fetch({
    url:`/netGrid/getNetGridDetail`,
    method:`post`,
    params:{
      id:id
    }
  })
}

export function deleteNetGrid(id){
  return fetch({
    url:`/netGrid/deleteNetGrid`,
    method:`post`,
    params:{
      id:id
    }
  })
}

export function addNetGrid(query){
  return fetch({
    url:`/netGrid/addNetGrid`,
    method:`post`,
    data:query
  })
}

export function updateNetGrid(query){
  return fetch({
    url:`/netGrid/updateNetGrid`,
    method:`post`,
    data:query
  })
}

export function getNetGridEventCount(){
  return fetch({
    url:`/netGrid/getNetGridEventCount`,
    method:`get`
  })
}

export function getNetGridMemberByFatherID(id){
  return fetch({
    url:`/netGrid/getNetGridMemberByFatherID`,
    method:`get`,
    params:{
      id:id
    }
  })
}

export function addNetGridMember(param){
  return fetch({
    url:`/netGridMember/addNetGridMember`,
    method:`post`,
    data:param
  })
}

export function getNetGridByFaterID(id){
  return fetch({
    url:`/netGrid/getNetGridByFaterID?netGridID=`+id,
    method:`get`
  })
}

export function getAllNetGrid(){
  return fetch({
    url:`/netGrid/getAllNetGrid`,
    method:`get`
  })
}

export function getNetGridMemberForOrg(id){
  return fetch({
    url:`/netGridMember/getNetGridMemberForOrg`,
    method:`get`,
    params:{
      id:id
    }
  })
}


// http://223.112.65.198:9898/msmis/dispute/getDisputeEventForNetGrid?page=1&pageSize=10 网格
// http://223.112.65.198:9898/msmis/SSEvent/getSSEventForNetGrid?page=1&pageSize=10 社会治安
// http://223.112.65.198:9898/msmis/trafficAccident/getTrafficAccidentForNetGrid?page=1&pageSize=10 交通事故
// http://223.112.65.198:9898/msmis/sp/getSPEventForNetGrid?page=1&pageSize=10 天网巡防

export function getDisputeEventOverdueCount(){
  return fetch({
    url:`/dispute/getOverdueCount`,
    method:`post`
  })
}
export function getSSEventOverdueCount(){
  return fetch({
    url:`/SSEvent/getOverdueCount`,
    method:`post`
  })
}
export function gettrafficAccidentOverdueCount(){
  return fetch({
    url:`/trafficAccident/getOverdueCount`,
    method:`post`
  })
}
export function getnetGridOverdueCount(){
  return fetch({
    url:`/netGrid/getOverdueCount`,
    method:`post`
  })
}
export function getSPEventOverdueCount(){
  return fetch({
    url:`/sp/getOverdueCount`,
    method:`post`
  })
}


export function getDisputeEventForNetGrid(query){
  return fetch({
    url:`/dispute/getDisputeEventForNetGrid`,
    method:`post`,
    params:query
  })
}

export function getSSEventForNetGrid(query){
  return fetch({
    url:`/SSEvent/getSSEventForNetGrid`,
    method:`post`,
    params:query
  })
}
export function getTrafficAccidentForNetGrid(query){
  return fetch({
    url:`/trafficAccident/getTrafficAccidentForNetGrid`,
    method:`post`,
    params:query
  })
}
export function getSPEventForNetGrid(query){
  return fetch({
    url:`/sp/getSPEventForNetGrid`,
    method:`post`,
    params:query
  })
}

export function getNetGridEventForNetGrid(query){
  return fetch({
    url:`/netGrid/getNetGridEventForNetGrid`,
    method:`post`,
    params:query
  })
}

export function deleteDisputeEvent(id){
  return fetch({
    url:`/dispute/deleteDisputeEvent`,
    method:`post`,
    params:{
      id:id
    }
  })
}

export function deleteNetGridEvent(id){
  return fetch({
    url:`/netGrid/deleteNetGridEvent`,
    method:`post`,
    params:{
      id:id
    }
  })
}

export function deleteSPEvent(id){
  return fetch({
    url:`/sp/deleteSPEvent`,
    method:`post`,
    params:{
      id:id
    }
  })
}

export function deleteSSEvent(id){
  return fetch({
    url:`/SSEvent/deleteSSEvent`,
    method:`post`,
    params:{
      id:id
    }
  })
}

export function deleteTrafficAccident(id){
  return fetch({
    url:`/trafficAccident/deleteTrafficAccident`,
    method:`post`,
    params:{
      id:id
    }
  })
}


export function getStaffInfo(k,param){
  return fetch({
    url:`/staff/${k}/getStaffInfo`,
    method:`post`,
    params:param
  })
}

export function addStaff(k,param){
  return fetch({
    url:`/staff/${k}/addStaff`,
    method:`post`,
    data:param
  })
}

export function updateStaff(k,param){
  return fetch({
    url:`/staff/${k}/updateStaff`,
    method:`post`,
    data:param
  })
}

export function deleteStaff(k,id){
  return fetch({
    url:`/staff/${k}/deleteStaff`,
    method:`post`,
    params:{
      id:id
    }
  })
}


export function getNetGridMemberForExcel(data){
  return fetch({
    url:'/netGridMember/getNetGridMemberForExcel',
    method:'post',
    params:data
  })
}
